<script lang="ts" setup>
import { useRouter } from "vue-router";

const router = useRouter();

defineProps({
  title: {
    type: String,
    default: "",
  },
  back: {
    type: Boolean,
  },
});

const goBack = () => {
  router.back();
};
</script>
<template>
  <h2
    class="text-2xl font-bold h-25 flex justify-center items-center mb-0 relative"
  >
    <img
      src="/console/back.png"
      alt=""
      @click="goBack"
      class="absolute h-8 left-0 cursor-pointer"
      v-if="back"
    />
    {{ title }}
  </h2>
  <slot />
</template>
<style lang="scss" scoped></style>
